﻿using Marmat.Foundation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace 测试项目
{
    class DataDictionaryManager : IDataDictionaryManager
    {
        public void AddDictionaryItem(string key, IDataDictionaryItem item)
        {
        }

        public IDataDictionaryCategory CreateCategory(string parent, string name)
        {
            return new DataDictionaryCategory() { Parent = parent, Key = name, Name = name, IsGroup = true };
        }

        public IDataDictionaryCategory CreateDictionary(string parent, string key, string name)
        {
            throw new NotImplementedException();
        }

        public void DeleteCategory(string[] key)
        {
        }

        public void DeleteDictionaryItem(string[] id)
        {
        }

        public IEnumerable<IDataDictionaryCategory> GetCategoryCollection()
        {
            yield return new DataDictionaryCategory() { Key = "system", Name = "系统设置", IsGroup = true, Parent = "" };
            yield return new DataDictionaryCategory() { Key = "a", Name = "系统设置", IsGroup = true, Parent = "system" };
            yield return new DataDictionaryCategory() { Key = "b", Name = "权限分配", IsGroup = false, Parent = "a" };

            yield return new DataDictionaryCategory() { Key = "caigou", Name = "采购", IsGroup = true, Parent = "" };
            yield return new DataDictionaryCategory() { Key = "caigou_1", Name = "采购订单", IsGroup = false, Parent = "caigou" };
            yield return new DataDictionaryCategory() { Key = "caigou_2", Name = "采购计划", IsGroup = false, Parent = "caigou" };
            yield return new DataDictionaryCategory() { Key = "付款方式", Name = "付款方式", IsGroup = false };
        }

        public void RenameCategory(string id, string name)
        {
        }

        public void RenameDictionaryItem(string id, string name, string text, string description)
        {
        }

        public void UpdateCategory(string key, string name, string parent)
        {
            throw new NotImplementedException();
        }
    }
}
